<?php
// feedbacks list page
require_once 'view/adm/content/feedbacks.index.php';


class FeedbacksIndexPage extends PageController {

	var $form;

    function FeedbacksIndexPage() {
        parent::PageController();

        $this->form =& new FormController();
        $this->form->addChild('apply', new ButtonController(new Delegate($this, 'apply')));
        $this->form->setDefaultChild('apply');

        	$this->form->addRule(new Handle('NumericRangeRule', array('article_id',0)));
        	$this->form->addRule(new Handle('NumericRangeRule', array('start_day',1,31)));
            $this->form->addRule(new Handle('NumericRangeRule', array('end_day',1,31)));
            $this->form->addRule(new Handle('NumericRangeRule', array('start_year',2000,2999)));
            $this->form->addRule(new Handle('NumericRangeRule', array('end_year',2000,2999)));


        $this->addChild('FilterForm', $this->form);
        $this->setDefaultChild('FilterForm');



        $this->setDefaultView(new Handle('FeedbacksListView', array('/adm/content/feedbacks.index.html')));

        $this->addView('success', WACT_DEFAULT_VIEW);
        $this->addView('notfound', WACT_DEFAULT_VIEW);
        $this->addView('delete', new Handle('RedirectView', array('/delete')));
    }

     //apply filter
    //save filter response model into session
    function apply(&$source, &$request, &$responseModel) {
    	//print 'Applying filter...';
    	Session::saveResponseModel($responseModel,'filter.feedbacks');
    }
}

?>